Packet loss processing method and network device

ABSTRACT

A packet loss processing method and a network device are provided. The method includes: A first node obtains a first forwarding label of a first packet, where the first packet is a discarded packet. The first node determines, based on the first forwarding label, that the first node does not have a LSP corresponding to the first forwarding label. The first node sends a first message to a second node, where the first message includes the first forwarding label, and the first message is used to indicate that the first node does not have the LSP corresponding to the first forwarding label. The second node may be, for example, a peer node of the first node. The first node sends the message to the peer node, to indicate that the first node does not have the LSP corresponding to the forwarding label.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to Chinese Patent Application No.202010615014.X, filed on Jun. 30, 2020. The disclosure of theaforementioned application is hereby incorporated by reference in itsentirety.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a packet loss processing method and a networkdevice.

BACKGROUND

Multi-protocol label switching (MPLS) is a technology that uses a labelto guide data transmission in an open communications network.Specifically, when a packet enters an MPLS network, a network device inthe MPLS network allocates a corresponding label to the packet, andencapsulates the label and the packet together. Therefore, the networkdevice may forward, in an entire forwarding process of the packet, thepacket based on the label.

In the MPLS network, when a service traffic packet loss occurs in a livenetwork, a packet loss cause needs to be quickly identified, and aservice needs to be restored, to ensure normal forwarding of servicetraffic. Currently, when the service traffic packet loss occurs in thelive network, operation and maintenance personnel usually log in to afaulty network device in the live network and a neighboring networkdevice of the faulty network device, to collect a large amount of entryinformation. The operation and maintenance personnel then deduce, basedon the collected information, a cause of a network device fault, andrestore the network device, thereby restoring the service.

A current fault rectification manner requires the operation andmaintenance personnel to collect a large amount of information andperform comparison and deduction. As a result, network rectificationefficiency is low, and normal forwarding of the service may be affectedfor a relatively long period of time.

SUMMARY

This application provides a packet loss processing method and a networkdevice. A first node obtains a forwarding label of a discarded packet,and sends a first message to a peer node of the first node whendetermining that the first node does not have a Label Switch Path (LSP)corresponding to the forwarding label. The first message includes theforwarding label, to indicate that the first node does not have the LSPcorresponding to the forwarding label. In this way, the peer node istriggered to check and rectify a forwarding table based on the firstmessage. This ensures normal forwarding of a service packet. Inaddition, the method is mainly automatically implemented by the networkdevice, so that network rectification efficiency is high, andrectification timeliness is relatively good.

A first aspect of this application provides a packet loss processingmethod. The method includes: A first node obtains a first forwardinglabel of a first packet, where the first packet is a discarded packet.The first node determines, based on the first forwarding label, that thefirst node does not have a label switch path (LSP) corresponding to thefirst forwarding label. For example, the first node finds, throughquerying, no LSP matching the first forwarding label at a protocollayer, or finds, through querying, an LSP matching the first forwardinglabel but in a down state. The first node sends a first message to asecond node, where the first message includes the first forwardinglabel, and the first message is used to indicate that the first nodedoes not have the LSP corresponding to the first forwarding label. Thesecond node may be, for example, a peer node of the first node.

In this solution, the first node obtains the forwarding label of thediscarded packet, and sends the first message to the peer node of thefirst node when determining that the first node does not have the LSPcorresponding to the forwarding label. The first message includes theforwarding label, to indicate that the first node does not have the LSPcorresponding to the forwarding label. In this way, the peer node istriggered to check or rectify a forwarding table based on the firstmessage. This ensures normal forwarding of a service packet. Inaddition, this solution is mainly automatically implemented by the node,which can reduce or avoid manual intervention. Therefore, networkrectification efficiency is high.

In one embodiment, that the first node determines that the first nodedoes not have a LSP corresponding to the first forwarding labelincludes: determining that the first node does not have an LSP whoseincoming label is the same as the first forwarding label.

In one embodiment, when a resource reservation protocol (RSVP) isdeployed on the first node, that the first node sends a first message toa second node includes: The first node determines an inbound interfacecorresponding to the first packet. The first node sends, based on theinbound interface, the first message to the second node corresponding tothe inbound interface. There may be one or more nodes corresponding tothe inbound interface, and the second node is one of the nodescorresponding to the inbound interface.

In one embodiment, when a label distribution protocol (LDP) is deployedon the first node, the first node may send the first message to all peernodes of the first node. The peer node of the first node may be a peernode that is directly connected to the first node and on which the LDPis deployed. Alternatively, the peer node of the first node may be apeer node that is not directly connected to the first node and on whichthe LDP is deployed, for example, a remote peer node that is connectedto the first node through another node.

In one embodiment, the method further includes: The first node obtains asecond forwarding label of a second packet, where the second packet is adiscarded packet. The first node determines, based on the secondforwarding label, that a protocol layer of the first node has an LSPcorresponding to the second forwarding label. The first node updates aforwarding table at a forwarding layer of the first node based on theLSP corresponding to the second forwarding label. In other words, entrydata of the LSP that is at the protocol layer of the first node and thatis corresponding to the second forwarding label may be delivered to theforwarding layer of the first node. Therefore, the forwarding table maybe updated, at the forwarding layer of the first node, based on theentry data delivered at the protocol layer, to refresh and restore datathat is in the forwarding table and that is corresponding to the secondforwarding label. In this way, it is ensured that a packet carrying thesecond forwarding label can be normally forwarded at the forwardinglayer of the first node.

In this solution, when determining that the protocol layer of the firstnode has the LSP corresponding to the forwarding label, the first nodemay determine that a packet loss is caused by an entry problem at theforwarding layer. Therefore, the first node delivers, from the protocollayer to the forwarding layer, the entry data of the corresponding LSP,to refresh and restore the forwarding table at the forwarding layer.This ensures normal forwarding of the service packet. The protocol layermay also be understood as a control plane, and the forwarding layer mayalso be understood as a forwarding plane.

In one embodiment, before a first node obtains a forwarding label of afirst packet, the method further includes: The first node determinesthat time for continuously discarding the packet including the firstforwarding label is greater than or equal to a preset duration, and thefirst node obtains the first packet corresponding to the forwardinglabel. In other words, the first node may continuously monitor whetherthe packet is successfully forwarded. If the first node finds, throughmonitoring, that the time in which the packet carrying the firstforwarding label fails to be forwarded continuously is greater than orequal to the preset duration, that is, when the first node continuouslydiscards the packet carrying the first forwarding label, the first nodedetermines that a fault cause needs to be analyzed and checked, topromptly perform troubleshooting on a premise of ensuring system runningstability.

In one embodiment, the first message is an RSVP message or an LDPmessage.

In one embodiment, the first message is an RSVP Hello message, the firstmessage carries object information, and the object information includesthe first forwarding label; or the first message is an LDP notificationmessage, the first message carries a type-length-value (TLV), and theTLV includes the first forwarding label. In one embodiment, the firstmessage further includes an address of the first node, for example, aninternet protocol (IP) address. The address of the first node may alsobe carried in the object information of the RSVP Hello message, orcarried in the TLV of the LDP notification message, to indicate anassociation relationship between the first forwarding label and thefirst node.

In one embodiment, the forwarding table includes one or more of a nexthop label forwarding entry (NHLFE) table and an incoming label mapping(ILM) table.

A second aspect of this application provides a packet loss processingmethod. The method includes: A second node receives a first message froma first node, where the first message includes a first forwarding label,and the first message is used to indicate that the first node does nothave an LSP corresponding to the first forwarding label. The second nodedetermines that the second node does not have an LSP corresponding tothe first forwarding label of the first node. The second node deletes aforwarding entry that is in the second node and that is corresponding tothe first forwarding label of the first node. In this solution, thefirst node obtains a forwarding label of a discarded packet, and sendsthe first message to the second node when determining that the firstnode does not have the LSP corresponding to the forwarding label. Thefirst message includes the forwarding label, to indicate that the firstnode does not have the LSP corresponding to the forwarding label. Inthis way, the second node is triggered to delete the forwarding entrybased on the first message. This ensures normal forwarding of a servicepacket. In addition, this solution is mainly automatically implementedby the node, which can reduce or avoid manual intervention. Therefore,network rectification efficiency is high.

In one embodiment, that the second node determines that the second nodedoes not have an LSP corresponding to the first forwarding label of thefirst node includes: The second node determines that the second nodedoes not have an LSP whose outgoing label is corresponding to the firstforwarding label and whose next-hop address is corresponding to anaddress of the first node. Alternatively, the second node determinesthat the second node has an LSP whose outgoing label is corresponding tothe first forwarding label and whose next-hop address is correspondingto an address of the first node, where the LSP is in a down state. Inthis solution, with reference to various possible cases, it may bedetermined, in a plurality of manners, that the second node does nothave the LSP corresponding to the first forwarding label and the addressof the first node. This improves flexibility of implementing thesolution.

In one embodiment, the method further includes: The second node receivesa second message from the first node, where the second message includesa third forwarding label, and the second message is used to indicatethat the first node does not have an LSP corresponding to the thirdforwarding label. The second node determines an LSP that is in thesecond node and that is corresponding to the third forwarding label ofthe first node. If the second node is an ingress node of the LSP(namely, the LSP corresponding to the third forwarding label of thefirst node), the second node reestablishes the LSP, or if the secondnode is not an ingress node of the LSP, the second node sends a thirdmessage to the ingress node of the LSP, where the third message is usedto indicate to reestablish the LSP.

In this solution, when checking that LSP entry data of the second nodeis inconsistent with LSP entry data of the first node, the second nodemay trigger the ingress node on the LSP to reestablish the LSP. In thisway, the LSP entry data of the first node and the LSP entry data of thesecond node are unified, and normal forwarding of the service packet isensured.

In one embodiment, the method further includes: The second node receivesa second message from the first node, where the second message includesa third forwarding label, and the second message is used to indicatethat the first node does not have an LSP corresponding to the thirdforwarding label. The second node determines an LSP that is in thesecond node and that is corresponding to the third forwarding label ofthe first node. The second node sends a fourth message to the firstnode, and the fourth message is used to indicate the first node tore-advertise a forwarding label.

In this solution, when the second node checks that the LSP entry data ofthe second node is inconsistent with the LSP entry data of the firstnode, the second node may trigger the first node to reallocate andadvertise a new forwarding label. In this way, the LSP entry data of thefirst node and the LSP entry data of the second node are unified, andnormal forwarding of the service packet is ensured.

In one embodiment, the first message is an RSVP message or an LDPmessage.

In one embodiment, the first message is an RSVP Hello message, the firstmessage carries object information, and the object information includesthe first forwarding label.

Alternatively, the first message is an LDP notification message, thefirst message carries a TLV, and the TLV includes the first forwardinglabel.

In one embodiment, the forwarding entry is included in one or more of anNHLFE table, an ILM table, and a forwarding equivalence class (FEC)table.

A third aspect of this application provides a network device, includinga transceiver unit and a processing unit. The transceiver unit isconfigured to obtain a first forwarding label of a first packet, wherethe first packet is a discarded packet. The processing unit isconfigured to determine, based on the first forwarding label, that afirst node does not have an LSP corresponding to the first forwardinglabel. The transceiver unit is further configured to send a firstmessage to a second node. The first message includes the firstforwarding label, and the first message is used to indicate that thefirst node does not have the LSP corresponding to the first forwardinglabel.

In one embodiment, the processing unit is configured to determine thatthe first node does not have an LSP whose incoming label is the same asthe first forwarding label.

In one embodiment, the processing unit is further configured todetermine an inbound interface corresponding to the first packet. Thetransceiver unit is further configured to send, based on the inboundinterface, the first message to the second node corresponding to theinbound interface.

In one embodiment, the transceiver unit is further configured to obtaina second forwarding label of a second packet, where the second packet isa discarded packet. The processing unit is further configured todetermine, based on the second forwarding label, that a protocol layerof the first node has an LSP corresponding to the second forwardinglabel. The processing unit is further configured to update a forwardingtable at a forwarding layer of the first node based on the LSPcorresponding to the second forwarding label.

In one embodiment, the processing unit is further configured todetermine that time for continuously discarding the packet including thefirst forwarding label is greater than or equal to a preset duration,and the first node obtains the first packet corresponding to theforwarding label.

In one embodiment, the first message is an RSVP message or an LDPmessage.

In one embodiment, the first message is an RSVP Hello message, the firstmessage carries object information, and the object information includesthe first forwarding label; or the first message is an LDP notificationmessage, the first message carries a type-length-value (TLV), and theTLV includes the first forwarding label.

In one embodiment, the forwarding table includes one or more of a nexthop label forwarding entry (NHLFE) table and an incoming label mapping(ILM) table.

A fourth aspect of this application provides a network device, includinga transceiver unit and a processing unit. The transceiver unit isconfigured to receive a first message from a first node, where the firstmessage includes a first forwarding label, and the first message is usedto indicate that the first node does not have an LSP corresponding tothe first forwarding label. The processing unit is configured todetermine that a second node does not have an LSP corresponding to thefirst forwarding label of the first node. The processing unit is furtherconfigured to delete a forwarding entry that is in the second node andthat is corresponding to the first forwarding label of the first node.

In one embodiment, the processing unit is further configured to:determine that the second node does not have an LSP whose outgoing labelis corresponding to the first forwarding label and whose next-hopaddress is corresponding to an address of the first node; or determinethat the second node has an LSP whose outgoing label is corresponding tothe first forwarding label and whose next-hop address is correspondingto an address of the first node, where the LSP is in a down state.

In one embodiment, the transceiver unit is further configured to receivea second message from the first node, where the second message includesa third forwarding label, and the second message is used to indicatethat the first node does not have an LSP corresponding to the thirdforwarding label. The processing unit is further configured to determinean LSP that is in the second node and that is corresponding to the thirdforwarding label of the first node and the address of the first node. Ifthe network device is an ingress node of the LSP, the processing unit isconfigured to reestablish the LSP, or if the network device is not aningress node of the LSP, the transceiver unit sends a third message tothe ingress node of the LSP, where the third message is used to indicateto reestablish the LSP.

In one embodiment, the transceiver unit is further configured to receivea second message from the first node, where the second message includesa third forwarding label, and the second message is used to indicatethat the first node does not have an LSP corresponding to the thirdforwarding label. The processing unit is further configured to determinean LSP that is in the second node and that is corresponding to the thirdforwarding label of the first node. The transceiver unit is furtherconfigured to send a fourth message to the first node, where the fourthmessage is used to indicate the first node to re-advertise a forwardinglabel.

In one embodiment, the first message is an RSVP message or an LDPmessage.

In one embodiment, the first message is an RSVP Hello message, the firstmessage carries object information, and the object information includesthe first forwarding label; or the first message is an LDP notificationmessage, the first message carries a TLV, and the TLV includes the firstforwarding label.

In one embodiment, the forwarding entry is located in one or more of anNHLFE table, an ILM table, and a forwarding equivalence class (FEC)table.

A fifth aspect of this application provides a network device. Thenetwork device includes a processor and a memory. The memory isconfigured to store instructions, and the processor is configured toexecute the instructions in the memory, to enable the network device toperform the method according to the first aspect or the second aspect.

A sixth aspect of this application provides a network device. Thenetwork device includes a processor. The processor is coupled to amemory, and the processor is configured to execute instructions in thememory, to enable the network device to perform the method according tothe first aspect or the second aspect.

A seventh aspect of this application provides a computer-readablestorage medium. The computer-readable storage medium may benon-volatile. The computer-readable storage medium storescomputer-readable instructions, and when the computer-readableinstructions are executed by a processor, the method in any embodimentaccording to the first aspect or the second aspect is implemented.

An eighth aspect of this application provides a computer program productincluding instructions. When the computer program product is run on acomputer, the computer is enabled to perform the method in anyembodiment according to the first aspect or the second aspect.

A ninth aspect of this application provides a chip system. The chipsystem includes a processor, configured to support a network device inimplementing a function in the foregoing aspect, for example, sending orprocessing data and/or information in the foregoing method. In apossible embodiment, the chip system further includes a memory. Thememory is configured to store program instructions and data of thenetwork device. The chip system may include a chip, or may include achip and another discrete component.

It can be learned from the foregoing technical solutions thatembodiments of this application have the following advantages.

The embodiments of this application provide the packet loss processingmethod and the network device. The first node obtains the forwardinglabel of the discarded packet, and sends the first message to the peernode of the first node when determining that the first node does nothave the LSP corresponding to the forwarding label. The first messageincludes the forwarding label and the address of the first node, toindicate that the first node does not have the LSP corresponding to theforwarding label. In this way, the peer node is triggered to check andrectify the forwarding table based on the first message. This ensuresnormal forwarding of the service packet. In addition, the method ismainly automatically implemented by the node, which can reduce or avoidmanual intervention. Therefore, the network rectification efficiency ishigh.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a network architecture according to anembodiment of this application;

FIG. 2 is a schematic flowchart of a packet loss processing method 200according to an embodiment of this application;

FIG. 3 is a schematic flowchart of a packet loss processing method 300according to an embodiment of this application;

FIG. 4 is a schematic flowchart of a packet loss processing method 400according to an embodiment of this application;

FIG. 5 is a schematic diagram of a format of information according to anembodiment of this application;

FIG. 6 is a schematic structural diagram of an RSVP Hello messageaccording to an embodiment of this application;

FIG. 7 is a schematic diagram of a format of an LDP notification messageaccording to an embodiment of this application;

FIG. 8 is a schematic diagram of a format of Status TLV according to anembodiment of this application;

FIG. 9 is a schematic diagram of a format of Status Code according to anembodiment of this application;

FIG. 10 is a schematic diagram of a format of an LDP SourceTrace TLVaccording to an embodiment of this application;

FIG. 11 is a schematic flowchart of a packet loss processing method 1100according to an embodiment of this application; and

FIG. 12 is a schematic structural diagram of a network device 1200according to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

To make objectives, technical solutions, and advantages of thisapplication clearer, the following describes embodiments of thisapplication with reference to accompanying drawings. It is clear thatthe described embodiments are merely some but not all of the embodimentsof this application. A person of ordinary skill in the art may learnthat, as a new application scenario emerges, the technical solutionsprovided in the embodiments of this application are also applicable to asimilar technical problem.

In the specification, claims, and accompanying drawings of thisapplication, the terms “first”, “second”, and the like are intended todistinguish between similar objects but do not necessarily indicate aparticular order or sequence. It should be understood that the datatermed in such a way are interchangeable in proper circumstances so thatthe embodiments of the present application described herein can beimplemented in other orders than the order illustrated or describedherein. Moreover, the terms “include”, “have” and any variants thereofmean to cover non-exclusive inclusion, for example, a process, method,system, product, or device that includes a list of operations or unitsis not necessarily limited to those operations or units, but may includeother operations or units not expressly listed or inherent to such aprocess, method, system, product, or device. Names or numbers ofoperations in this application do not mean that operations in a methodprocedure need to be performed according to a chronological/logicalorder indicated by the names or numbers. An execution sequence of theoperations in the procedure that have been named or numbered may bechanged based on technical objectives to be implemented, provided that asame or similar technical effect can be achieved. Division into units inthis application is logical division and may be other division in anactual implementation. For example, a plurality of units may be combinedor integrated into another system, or some features may be ignored ornot performed. In addition, the displayed or discussed mutual couplingsor direct couplings or communications connections may be implementedthrough some interfaces. The indirect couplings or communicationsconnections between the units may be implemented in electronic or otherforms. This is not limited in this application. In addition, units orsubunits described as separate parts may or may not be physicallyseparate, may or may not be physical units, or may be distributed in aplurality of circuit units. Some or all of the units may be selectedbased on actual requirements to achieve the objectives of the solutionsof this application.

An MPLS technology is a common technology of an internet protocol (IP)bearer network, and is a technology that uses a label to guide datatransmission in an open communications network. Usually, the MPLSnetwork includes an ingress node, a transit node, and an egress node.The ingress node may be an ingress label edge router (LER) of a packet,and is responsible for adding a label to a packet entering an MPLSdomain. The transit node may be a label switching router (LSR) in theMPLS domain, and is responsible for transporting, based on the label,the packet to the egress node along an LSP including a series of LSRs.The egress node is an egress LER of the packet, and is responsible forremoving the label from the packet and forwarding the packet to adestination network.

Currently, an RSVP and an LDP are commonly used for implementing labelnegotiation. The two protocols require that a label is sent from anegress node to an ingress node hop by hop. Each upstream node on an LSPstores a next hop and outgoing label information whose destinations area downstream node, to complete MPLS packet forwarding. By sending labelshop by hop, nodes in an MPLS network can map network-layer routinginformation such as incoming labels, next-hop nodes, and outgoing labelsto a switched path at a data link layer, thereby establishing the LSP.The LSP can transmit service traffic of various public and privatenetworks. However, when an unknown fault occurs on a node on the LSP, aservice traffic packet loss may occur.

In the MPLS network, if a service traffic packet loss occurs in a livenetwork, a packet loss cause needs to be quickly identified, and aservice needs to be restored as soon as possible, to ensure normalforwarding of service traffic. Currently, when the service trafficpacket loss occurs in the live network, operation and maintenancepersonnel usually log in to a faulty network device in the live networkand a neighboring network device of the faulty network device, tocollect a large amount of entry information such as entry information ofan upper-layer communications protocol, entry information of amiddle-layer bearer component, and entry information of bottom-layerforwarding. The operation and maintenance personnel then deduce, basedon the collected information, a cause of a network device fault, andrestore the network device, thereby restoring the service.

However, this fault rectification manner requires the operation andmaintenance personnel to collect the large amount of information on thedevice and compare the information, to determine the cause of thenetwork fault. The procedure is complex. As a result, networkrectification efficiency is low, and normal forwarding of the service isaffected for a long period of time.

In view of this, the embodiments of this application provide a packetloss processing method. A first node obtains a forwarding label of adiscarded packet, and sends a first message to a peer node of the firstnode when determining that the first node does not have an LSPcorresponding to the forwarding label. The first message includes theforwarding label and an address of the first node, to indicate that thefirst node does not have the LSP corresponding to the forwarding label.In this way, the peer node is triggered to check and rectify aforwarding table based on the first message. This ensures normalforwarding of a service packet. In addition, the method is mainlyautomatically implemented by the node, which can reduce or avoid manualintervention. Therefore, the network rectification efficiency is high.

FIG. 1 is a schematic diagram of a network architecture according to anembodiment of this application. As shown in FIG. 1, an MPLS networkincludes a node 1 and a node 2 that are connected to each other, and thenode 1 and the node 2 are two nodes on an LSP. The node 1 is an upstreamnode device, and the node 2 is a downstream node device. The node 1stores label information whose destination is the downstream node device(namely, the node 2), and the node 1 can forward an MPLS packet to thenode 2 based on the label information. When the packet sent by the node1 to the node 2 is lost, the node 2 obtains a discarded packet. When thenode 2 determines, based on a forwarding label of the discarded packet,that a protocol layer of the node 2 does not have an LSP correspondingto the forwarding label, the node 2 may send a message to the node 1.The message includes the forwarding label and an address of the node 2,to indicate that the node 2 does not have the LSP corresponding to theforwarding label. In this way, after receiving the message, the node 1may determine whether the node 1 has the LSP corresponding to theforwarding label. When the node 1 does not have the LSP corresponding tothe forwarding label, the node 1 may delete, based on a particularsituation, a forwarding table corresponding to the forwarding label, ortrigger an ingress node to perform operations such as reestablishing theLSP, thereby implementing network fault rectification and ensuringnormal forwarding of a service.

It may be understood that the node 1 and the node 2 may be twoindependent network devices, or the node 1 and the node 2 may be twounits having a forwarding function in a same network device. The networkdevice may be, for example, a digital communications device, such as arouter, a switch, or a firewall, configured with the MPLS protocol. Forease of description, in the following embodiment, the packet lossprocessing method provided in the embodiments of this application isdescribed in detail by using an example in which the node 1 and the node2 are the two independent network devices.

FIG. 2 is a schematic flowchart of a packet loss processing method 200according to an embodiment of this application. As shown in FIG. 2, thepacket loss processing method 200 includes the following operations.

Operation 201: A first node obtains a first forwarding label of a firstpacket, where the first packet is a discarded packet.

In this embodiment, the first packet may be a packet received by thefirst node from another node. However, because the first node cannotsuccessfully forward the first packet, the first node discards the firstpacket.

For example, when the first node receives the first packet carrying thefirst forwarding label, if the first node cannot find a matchedforwarding table based on the first forwarding label of the firstpacket, the first node discards the first packet. It may be understoodthat, when a node forwards a packet, the node usually searches for aforwarding table in which an incoming label in the forwarding tablematches a forwarding label of the packet, and forwards the packet basedon a next hop in the matched forwarding table. If finding that noforwarding table matches the forwarding label of the packet, the nodemay consider that the forwarding label of the packet is invalid, anddiscard the packet.

It may be understood that, in a process in which the first node forwardsthe packet, the first node may also discard the received packet due tovarious other causes. For example, when a bit error occurs in the packetreceived by the first node, the first node may discard the packet.Alternatively, due to an inter-board time sequence problem, the firstnode may temporarily discard the packet. The foregoing packet losscauses usually cause an occasional transient packet loss, which is anormal case of packet forwarding in a network. Therefore, for thetransient packet loss caused by the foregoing packet loss cause, thenode does not need to be triggered to perform troubleshooting andrectification. For a packet loss that lasts for a long time, it can beconsidered that a fault occurs between nodes. Therefore, troubleshootingand rectification need to be triggered for the nodes.

In one embodiment, before a first node obtains a first forwarding labelof a first packet, the first node may determine that time forcontinuously discarding the packet corresponding to the first forwardinglabel is greater than or equal to a preset duration, and the first nodeobtains the first packet corresponding to the forwarding label. In otherwords, the first node may continuously monitor whether the packet issuccessfully forwarded. If the first node finds, through monitoring,that the time in which the packet carrying the first forwarding labelfails to be forwarded continuously is greater than or equal to thepreset duration, that is, the first node continuously discards thepacket carrying the first forwarding label, the first node may considerthat continuous discarding of the packet is caused by the faultoccurring between the nodes. Therefore, the first node may obtain thediscarded first packet, and parse the first packet, to obtain the firstforwarding label of the first packet. The preset duration may be, forexample, 2 minutes or 3 minutes, and a value of the preset duration maybe determined based on an actual situation. This is not limited in thisembodiment.

In a possible embodiment, the first node includes a forwarding layer,and the forwarding layer is used to forward a packet. Processes such asmonitoring whether the packet is successfully forwarded, obtaining thefirst packet, and obtaining the first forwarding label of the firstpacket may be executed at the forwarding layer of the first node.

Operation 202: The first node determines, based on the first forwardinglabel, that the first node does not have an LSP corresponding to thefirst forwarding label.

In a possible embodiment, the first node includes a protocol layer, andthe LSP in which the first node is located is stored at the protocollayer. The first forwarding label may be sent, at the forwarding layerof the first node, to the protocol layer of the first node, and the LSPmatching the first forwarding label may be queried at the protocol layerbased on the first forwarding label, that is, an LSP whose incominglabel in the LSP is the same as the first forwarding label is queried.

In this embodiment, when the LSP matching the first forwarding label isnot found, through querying, at the protocol layer, or when an LSPmatching the first forwarding label but in a down state is found,through querying, at the protocol layer, the first node may determinethat the first node does not have the LSP corresponding to the firstforwarding label.

Operation 203: The first node sends a first message to a second node,where the first message includes the first forwarding label, and thefirst message is used to indicate that the first node does not have theLSP corresponding to the first forwarding label.

In this embodiment, the second node may be an upstream node of the firstnode. In other words, the first packet received by the first node issent by the second node to the first node.

In one embodiment, the first node may send the first message to all peernodes of the first node. Because the second node is one peer node of thefirst node, when the first node sends the first message to all the peernodes, it can be ensured that the second node (namely, the upstream nodeof the first node) can receive the first message. For example, when anLDP is deployed on the first node, the first node may send the firstmessage to all the peer nodes of the first node. The peer node of thefirst node may be a peer node that is directly connected to the firstnode and on which the LDP is deployed. Alternatively, the peer node ofthe first node may be a peer node that is not directly connected to thefirst node and on which the LDP is deployed, for example, a remote peer(remote peer) node that is connected to the first node through anothernode.

In one embodiment, the first node may determine an inbound interfacecorresponding to the first packet; and the first node sends, based onthe inbound interface, the first message to the second nodecorresponding to the inbound interface. There may be one or more nodescorresponding to the inbound interface, and the second node is one ofthe nodes corresponding to the inbound interface. When the first nodesends the first message to the node corresponding to the inboundinterface, it can also be ensured that the second node can receive thefirst message, and a range of nodes to which the first node sends thefirst message is reduced. This effectively saves a signaling resource ofthe first node. For example, when an RSVP is deployed on the first node,the first node may send the first message to the node corresponding tothe inbound interface.

In an example, the inbound interface of the first packet may be obtainedby parsing the first packet at the forwarding layer of the first node,and the inbound interface of the first packet is sent to the protocollayer of the first node. In this way, the first message can be sent,based on the inbound interface at the protocol layer of the first node,to the second node corresponding to the inbound interface.

Operation 204: The second node determines that the second node does nothave an LSP corresponding to the first forwarding label and an addressof the first node.

It may be understood that, after the second node receives the firstmessage sent by the first node, the second node parses the firstmessage, to obtain the first forwarding label in the first message, andmay also obtain the address of the first node. In this way, the secondnode may query whether the second node has the LSP corresponding to thefirst forwarding label of the first node.

In this embodiment, the second node may determine, in a plurality ofmanners, that the second node does not have the LSP corresponding to thefirst forwarding label of the first node.

In one embodiment, the second node may determine whether an outgoinglabel in the LSP is corresponding to the first forwarding label (thatis, whether the outgoing label in the LSP is the same as the firstforwarding label), and whether a next-hop address in the LSP iscorresponding to the address of the first node (that is, whether thenext-hop address in the LSP is the same as the address of the firstnode). If determining that the second node does not have an LSP whoseoutgoing label is corresponding to the first forwarding label and whosenext-hop address is corresponding to the address of the first node, thesecond node may determine that the second node does not have the LSPcorresponding to the first forwarding label and the address of the firstnode.

In one embodiment, if determining that the second node has an LSP whoseoutgoing label is corresponding to the first forwarding label and whosenext-hop address is corresponding to the address of the first node,where the LSP is in a down state, the second node may also determinethat the second node does not have the LSP corresponding to the firstforwarding label and the address of the first node.

In the foregoing two possible embodiments, a corresponding operation maybe performed at a protocol layer of the second node.

Operation 205: The second node deletes a second forwarding entry that isin the second node and that is corresponding to the first forwardinglabel of the first node.

In this embodiment, when the second node determines that the second nodedoes not have the LSP corresponding to the first forwarding label of thefirst node, the second node may consider that an entry including LSPinformation is inconsistent with a forwarding entry used to performforwarding, that is, the forwarding table has a residual entry. As aresult, the first packet is incorrectly forwarded to the first node.Therefore, in this case, the second node may delete the residual entry(namely, a forwarding entry that is in the second node and that iscorresponding to the first forwarding label) in the forwarding table, toimplement fault rectification.

In one embodiment, the protocol layer of the second node is used toreceive the first message from the first node, and determine, based onthe first message, that the protocol layer does not have the LSPcorresponding to the first forwarding label of the first node, tofurther determine that the forwarding table at the forwarding layer ofthe second node has the residual entry. For example, when it isdetermined that no LSP corresponding to the first forwarding label ofthe first node exists at the protocol layer of the second node,indication information may be delivered, at the protocol layer of thesecond node, to the forwarding layer of the second node. The indicationinformation is used to indicate that no LSP corresponding to the firstforwarding label of the first node exists at the protocol layer. In thisway, when the indication information is received at the forwarding layerof the second node, the forwarding entry corresponding to the firstforwarding label of the first node may be deleted at the forwardinglayer of the second node.

The forwarding entry is an entry belonging to one or more of an NHLFEtable, an ILM table, and an FEC table.

In this embodiment, the first node obtains the forwarding label of thediscarded packet, and sends the first message to the peer node of thefirst node when determining that the first node does not have the LSPcorresponding to the forwarding label. The first message includes theforwarding label, to indicate that the first node does not have the LSPcorresponding to the forwarding label. In this way, the peer node istriggered to check and rectify the forwarding table based on the firstmessage. This ensures normal forwarding of a service packet.

The foregoing describes a process in which the second node triggerschecking of the forwarding table based on the first message sent by thefirst node, and implements fault rectification by deleting theforwarding table that has the residual entry. The following describes indetail a process in which the second node triggers to reestablish theLSP based on a message sent by the first node, to implement faultrectification.

FIG. 3 is a schematic flowchart of a packet loss processing method 300according to an embodiment of this application. As shown in FIG. 3, thepacket loss processing method 300 includes the following operations.

Operation 301: The second node receives a second message from the firstnode, where the second message includes a third forwarding label, andthe second message is used to indicate that the first node does not havean LSP corresponding to the third forwarding label.

In this embodiment, the second message sent by the first node may besent to the second node after the first node receives a packet that issent by the second node and that carries the third forwarding label, andcontinuously discards the packet. In other words, the first node maysend the second message to the second node when determining that thefirst node does not have the LSP corresponding to the third forwardinglabel. In one embodiment, a process in which the first node sends thesecond message is similar to the foregoing operations 201 to 203. Fordetails, refer to the foregoing operations 201 to 203. Details are notdescribed herein again.

Operation 302: The second node determines an LSP that is in the secondnode and that is corresponding to the third forwarding label of thefirst node.

It may be understood that, similar to operation 204, the second node maydetermine, based on the third forwarding label in the second message,whether there is the matched LSP. Different from operation 204, in thisembodiment, the second node determines the LSP that is in the secondnode and that is corresponding to the third forwarding label of thefirst node. In other words, the second node has an LSP whose outgoinglabel is the same as the third forwarding label and whose next-hopaddress is the same as the address of the first node. In one embodiment,a corresponding operation in this operation may be performed at theprotocol layer of the second node. It may be understood that, if the LSPcorresponding to the label may be determined by using only the thirdforwarding label, for example, if the third forwarding label is globallyunique, the matched LSP may be determined based on the third forwardinglabel of the first node. In another case, the third forwarding label maynot be globally unique. For example, a same third forwarding label maybe allocated to different nodes. In this case, whether there is the LSPmatching the third forwarding label of the first node may be determinedbased on the third forwarding label in the second message and theaddress of the first node.

Operation 303: If the second node is an ingress node of the LSP, thesecond node reestablishes the LSP corresponding to the third forwardinglabel.

An example in which operation 302 is performed at the protocol layer ofthe second node is still used. When it is determined that the protocollayer of the second node has the LSP corresponding to the thirdforwarding label of the first node, entry data of the protocol layer ofthe second node is consistent with entry data of the forwarding layer ofthe second node. However, the first node does not have the LSPcorresponding to the third forwarding label. In other words, LSP entrydata at the protocol layer of the first node is inconsistent with LSPentry data at the protocol layer of the second node. In this case, theLSP entry data at the protocol layer of the first node and the LSP entrydata at the protocol layer of the second node need to be unified, toimplement fault rectification.

In this embodiment, the RSVP is deployed on both the first node and thesecond node. When the second node is the ingress node of the LSPcorresponding to the third forwarding label of the first node, thesecond node may directly trigger to reestablish the LSP, so that thefirst node reallocates a forwarding label and sends the forwarding labelto the second node. For example, the second node may send a requestmessage to an egress node on the LSP, to request each node in adirection from the egress node to the ingress node to send thereallocated forwarding label hop by hop, thereby unifying the LSP entrydata of the first node and the LSP entry data of the second node. Inaddition, after the second node triggers to reestablish the LSP, thesecond node may delete the LSP that is at the protocol layer and that iscorresponding to the third forwarding label of the first node, anddelete a forwarding entry corresponding to the third forwarding label ofthe first node. The forwarding entry may be located at the forwardinglayer.

Operation 304: If the second node is not an ingress node of the LSP, thesecond node sends a third message to the ingress node of the LSP, wherethe third message is used to indicate to reestablish the LSP.

In this embodiment, when the second node is not the ingress node of theLSP, the second node cannot directly trigger to reestablish the LSP.Therefore, the second node may send the third message to the ingressnode, thereby indicating the ingress node to reestablish the LSP.Similarly, the ingress node may send a request message to an egress nodeon the LSP, to request each node in a direction from the egress node tothe ingress node to send the reallocated forwarding label hop by hop,thereby unifying the LSP entry data of the first node and the LSP entrydata of the second node. In addition, after the second node sends thethird message to the ingress node, the second node may delete the LSPthat is at the protocol layer and that is corresponding to the thirdforwarding label and the address of the first node, and delete aforwarding table that is at the forwarding layer and that iscorresponding to the third forwarding label and the address of the firstnode.

In this embodiment, when checking that the LSP entry data of the secondnode is inconsistent with the LSP entry data of the first node, thesecond node may trigger to reestablish the LSP, thereby unifying the LSPentry data of the first node and the LSP entry data of the second node,and ensuring normal forwarding of a service packet. In addition, themethod is mainly automatically implemented by the node, which can reduceor avoid manual intervention. Therefore, network rectificationefficiency is high.

The foregoing describes a process in which the second node triggers toreestablish the LSP based on the message sent by the first node, toimplement fault rectification. The following describes in detail aprocess in which the second node triggers, based on a message sent bythe first node, the first node to re-advertise a forwarding label, toimplement fault rectification.

FIG. 4 is a schematic flowchart of a packet loss processing method 400according to an embodiment of this application. As shown in FIG. 4, thepacket loss processing method 400 includes the following operations.

Operation 401: The second node receives a second message from the firstnode, where the second message includes a third forwarding label, andthe second message is used to indicate that the first node does not havean LSP corresponding to the third forwarding label.

Operation 402: The second node determines, based on the third forwardinglabel of the first node, an LSP that is in the second node and that iscorresponding to the third forwarding label.

It may be understood that operations 401 and 402 are similar to theforegoing operations 301 and 302. For details, refer to the foregoingoperations 301 and 302. Details are not described herein again.

Operation 403: The second node sends a fourth message to the first node,where the fourth message is used to indicate the first node tore-advertise a forwarding label.

In this embodiment, the LDP is deployed on both the first node and thesecond node. When the second node determines that LSP entry data at theprotocol layer of the second node is inconsistent with LSP entry data atthe protocol layer of the first node, the second node may unify the LSPentry data at the protocol layers of the two nodes by requesting thefirst node to re-advertise the forwarding label, thereby implementingfault rectification.

For example, the second node may send the fourth message to the firstnode, to indicate the first node to re-advertise a forwarding label.After receiving the fourth message, the first node may reallocate anincoming label on the LSP, and send, to the second node through a labelmapping message, incoming label information reallocated by the firstnode. In this way, after receiving the reallocated incoming labelinformation, the second node may update the LSP entry data at theprotocol layer and the forwarding table at the forwarding layer, therebyunifying the LSP entry data of the first node and the LSP entry data ofthe second node. In this way, fault rectification is implemented, andnormal forwarding of a service packet is ensured.

In this embodiment, when the second node checks that the LSP entry dataof the second node is inconsistent with the LSP entry data of the firstnode, the second node may trigger the first node to reallocate andadvertise a new forwarding label. In this way, the LSP entry data of thefirst node and the LSP entry data of the second node are unified, andnormal forwarding of the service packet is ensured.

The foregoing describes in detail a process of the packet lossprocessing method. For ease of understanding, the following describes indetail, with reference to an example, a process in which the first nodesends a message to the second node.

In one embodiment, the RSVP is configured between the first node and thesecond node, and the first message sent by the first node to the secondnode is an RSVP message. For example, the first message in the foregoingmethod embodiments may be, for example, an RSVP Hello message. The firstnode carries the forwarding label and the address of the first node inthe RSVP Hello message by performing object extension on the RSVP Hellomessage. The address of the first node may be, for example, an IPaddress of the first node.

For example, a format of the RSVP Hello message before object extensionis performed is as follows:

-   -   <Hello Message>::=<Common Header>        -   <HELLO>.

Hello Message represents the RSVP Hello message, Common Headerrepresents a common message header, and HELLO represents particularmessage content in the RSVP Hello message.

A format of an RSVP Hello message obtained after object extension isperformed is as follows:

-   -   <Hello Message>::=<Common Header>        -   <HELLO>[NBR INFO PRIVATE].

Compared with the RSVP Hello message before extension, the RSVP Hellomessage after extension extends a new object, and the new object may be,for example, NBR_INFO_PRIVATE. NBR_INFO_PRIVATE represents neighborprivate information.

In a possible example, FIG. 5 is a schematic diagram of a format ofinformation according to an embodiment of this application. Theinformation may be, for example, referred to as the neighbor privateinformation. In FIG. 5, Length represents a length of the neighborprivate information, and a unit of the length is bytes. Class-Num refersto a class number, and a value of Class-Num in this embodiment may be191. C-Type refers to a type, and a value of C-Type may be 191. Thevalue of 191 of Class-Num and the value of 191 of C-Type are reserved,in the standard protocol, for vendors to perform private extension, andrepresents that the object is ignored and not forwarded and no errorinformation is generated when an object whose value of Class-Num andvalue of C-Type are 191 is received and cannot be identified, to ensureobject compatibility. Enterprise Code represents enterprise code. SubTLV represents a sub-TLV, and Sub TLV may be used to encapsulate apacket loss SourceTrace parameter.

For example, the packet loss SourceTrace parameter may include aforwarding label, an IP address of the first node, an identifier of thefirst node, a SourceTrace request identifier, and a key of an LSPcorresponding to the forwarding label. The identifier of the first nodemay be, for example, a label switching router (LSR) ID, a devicecomponent ID of the first node, or a loopback address of the first node,and is used to represent a node that initiates a SourceTrace request.The SourceTrace request identifier is used to represent an identifier ofthe RSVP Hello message sent by the first node, and the SourceTracerequest is the RSVP Hello message that is sent by the first node andthat is used to trigger self-checking and repairing of the second node.LSP key is used to represent an LSP determined by the first node basedon the forwarding label.

In a possible example, FIG. 6 is a schematic structural diagram of anRSVP Hello message according to an embodiment of this application. Asshown in FIG. 6, the RSVP Hello message includes an IP header, an RSVPcommon header, a Hello object, and NBR_INFO_PRIVATE. Sub TLV isencapsulated in NBR_INFO_PRIVATE, and Sub TLV includes Label, NextHop,Session, and SenderTemplate. Label represents a forwarding label.NextHop represents a next hop, and may be an address of a node thatsends the RSVP Hello message. Session object and SenderTemplate objectare used to jointly represent LSP key.

In one embodiment, an LDP is configured between the first node and thesecond node, and the first message sent by the first node to the secondnode is an LDP message. For example, the first message may be, forexample, an LDP notification message. The first node carries theforwarding label and the address of the first node in the LDPnotification message by performing TLV extension on the LDP notificationmessage. The address of the first node may be, for example, an IPaddress of the first node.

For example, FIG. 7 is a schematic diagram of a format of an LDPnotification message according to an embodiment of this application. Asshown in FIG. 7, the LDP notification message includes Message Length,Message ID, Status (TLV), and Optional Parameters. Message Lengthrepresents a length of the LDP notification message. Message IDrepresents an identifier of the LDP notification message, and isgenerated when the LDP notification message is generated. Status (TLV)represents a status TLV, and is used to represent a function of the LDPnotification message. Optional Parameters represents an optionalparameter, and may be used to encapsulate an LDP SourceTrace TLV. TheLDP SourceTrace TLV includes a packet loss SourceTrace parameter.

In an example, FIG. 8 is a schematic diagram of a format of Status TLVaccording to an embodiment of this application. As shown in FIG. 8,Status TLV includes Length, Status Code, Message ID, and Message Type.Length represents a length of Status TLV. Status Code represents statuscode, and is used to represent a function of the LDP notificationmessage. A value of Message ID may be set to 0, which is used torepresent that Status TLV is not triggered to be sent because of aparticular protocol message. A value of Message Type may be set to 0,which is used to represent that Status TLV is not triggered to be sentcurrently because of a particular protocol message.

FIG. 9 is a schematic diagram of a format of Status Code according to anembodiment of this application. As shown in FIG. 9, Status Code includesan E-bit, an F-bit, and Status Data. A value of the E-bit may be set to0, which is used to represent that Status Code is not fatal error statuscode. A value of the F-bit may be set to 0, which is used to representthat a peer node does not need to forward the LDP notification messageafter receiving the LDP notification message. A value of Status Data canbe set to 0x3F000EEF, which is used to represent that the LDPnotification message is a message used to transmit a packet lossSourceTrace parameter.

FIG. 10 is a schematic diagram of a format of an LDP SourceTrace TLVaccording to an embodiment of this application. As shown in FIG. 10, theLDP SourceTrace TLV includes a U-bit (Unknown TLV bit, U-bit), an F-bit(Forward unknown TLV bit, F-bit), Type, Vendor ID, and Data. A value ofthe U-bit may be set to 0, which is used to represent that if a peer endreceives the TLV and finds that the TLV cannot be identified, the peerend needs to ignore the TLV, and continues to process a remaining partof the current message. A value of the F-bit may be set to 0, which isused to represent that a peer end receives the TLV and does not need tocontinue to forward a message carrying the TLV. A value of Type may beset to 0x3E0B, which is used to represent that LDP SourceTrace TLV is aprivate TLV used to carry a packet loss SourceTrace parameter. Vendor IDrepresents a vendor ID. Data is used to encapsulate the packet lossSourceTrace parameter. The packet loss SourceTrace parameter may includea forwarding label, an IP address of the first node, an identifier ofthe first node, a SourceTrace request identifier, and a key of an LSPcorresponding to the forwarding label.

It may be understood that particular content carried in the foregoingmessage is merely used as an example, and in actual application, messagecontent may be selected with reference to a particular scenario and arequirement. For example, when the forwarding label is globally unique,the RSVP Hello message may either not carry the address of the firstnode. Alternatively, in another case, the RSVP Hello message is carriedin a packet, and the address of the first node is located at anotherlocation in the packet other than the RSVP Hello message. Alternatively,the value of C-Type in the RSVP Hello message may be another value.

The foregoing describes a process of implementing fault rectification bythe first node sending the message to the second node when the firstnode determines that the first node does not have the LSP correspondingto the forwarding label. The following describes in detail a process ofimplementing fault rectification by the first node itself when the firstnode determines that the first node has the LSP corresponding to theforwarding label.

FIG. 11 is a schematic flowchart of a packet loss processing method 1100according to an embodiment of this application. As shown in FIG. 11, thepacket loss processing method 1100 includes the following operations.

Operation 1101: The first node obtains a second forwarding label of asecond packet, where the second packet is a discarded packet.

In this embodiment, operation 1101 is similar to the foregoing operation201. For details, refer to the foregoing operation 201. Details are notdescribed herein again.

Operation 1102: The first node determines, based on the secondforwarding label, the LSP that is in the first node and that iscorresponding to the second forwarding label.

Different from operation 202, in operation 1102, the LSP matching thesecond forwarding label can be found at the protocol layer of the firstnode through querying, that is, can find, through querying, an LSP whoseincoming label is the same as the second forwarding label.

In other words, the protocol layer of the first node has the LSPcorresponding to the second forwarding label, but the forwarding layerof the first node does not have a forwarding table corresponding to thesecond forwarding label. As a result, the second packet is discarded atthe forwarding layer of the first node because the forwarding layer ofthe first node cannot match the forwarding table corresponding to thesecond forwarding label.

Operation 1103: The first node updates the forwarding table in the firstnode based on the LSP corresponding to the second forwarding label.

In this embodiment, the entry data that is at the protocol layer of thefirst node and that is corresponding to the second forwarding label maybe delivered to the forwarding layer of the first node. Therefore, thefirst forwarding table may be updated, at the forwarding layer of thefirst node, based on the entry data delivered at the protocol layer, torefresh and restore data that is in the forwarding table and that iscorresponding to the second forwarding label. In this way, it is ensuredthat a packet carrying the second forwarding label can be normallyforwarded at the forwarding layer of the first node.

For example, the first forwarding table may include one or more of anNHLFE table and an ILM table.

In this embodiment, when the first node determines that the protocollayer of the first node has the LSP corresponding to the forwardinglabel, the first node delivers the entry data of the corresponding LSPfrom the protocol layer to the forwarding layer, to refresh and restorethe forwarding table at the forwarding layer, thereby ensuring normalforwarding of the service packet. In addition, the entire process isautomatically implemented by the node, which can reduce or avoid manualintervention. Therefore, the network rectification efficiency is high.

In the foregoing embodiments, the example in which the RSVP or the LDPis deployed on the node in the network is used to describe a scenario towhich the packet loss processing method provided in the embodiment ofthis application is applied. It may be understood that the packet lossprocessing method provided in the embodiments of this application mayfurther be applied to a network scenario in which another protocol isdeployed. A type of a protocol deployed in a network to which theembodiments of this application are applied is not uniquely limitedherein.

To implement the foregoing embodiment, this application further providesa network device. FIG. 12 is a schematic structural diagram of a networkdevice 1200 according to an embodiment of this application.

Although the network device 1200 shown in FIG. 12 shows some features, aperson skilled in the art may be aware from the embodiments of thisapplication that, for brevity, FIG. 12 does not show various otherfeatures, to avoid confusing more related aspects of the implementationsdisclosed in the embodiments of this application. For this purpose, asan example, in some implementations, the network device 1200 includesone or more processing units (CPU) 1201, a network interface 1202, aprogramming interface 1203, a memory 1204, and one or morecommunications buses 1205 that are configured to interconnect variouscomponents. In some other implementations, some functional components orunits may be omitted or added to the network device 1200 based on theforegoing examples.

In some implementations, in addition to another purpose, the networkinterface 1202 is configured to connect to one or more other networkdevices/servers in a network system. In some implementations, thecommunications bus 1205 includes a circuit that interconnects andcontrols communication between system components. The memory 1204 mayinclude a non-volatile memory, for example, a read-only memory (ROM), aprogrammable read-only memory (PROM), an erasable programmable read-onlymemory (EPROM), an electrically erasable programmable read-only memory(EEPROM), or a flash memory. The memory 1204 may also include a volatilememory. The volatile memory may be a random access memory (RAM), and isused as an external cache.

In some implementations, a non-transitory computer-readable storagemedium or the memory 1204 stores the following programs, modules, anddata structures, or a subset thereof, which includes an operating system12041, a transceiver unit (not shown in the figure), and a processingunit 12042.

The operating system 12041 is used to process various basic systemservices and a process used to perform a hardware-related task.

In a possible embodiment, the network device 1200 may be, for example,the network device in the foregoing embodiment. The network device 1200may include, for example, a transceiver unit and the processing unit12042. The transceiver unit is configured to obtain a first forwardinglabel of a first packet, where the first packet is a discarded packet.The processing unit 12042 is configured to determine, based on the firstforwarding label, that the first node does not have an LSP correspondingto the first forwarding label. The transceiver unit is furtherconfigured to send a first message to a second node. The first messageincludes the first forwarding label, and the first message is used toindicate that the first node does not have the LSP corresponding to thefirst forwarding label.

In one embodiment, the processing unit 12042 is configured to determinethat the first node does not have an LSP whose incoming label is thesame as the first forwarding label.

In one embodiment, the processing unit 12042 is further configured todetermine an inbound interface corresponding to the first packet. Thetransceiver unit is further configured to send, based on the inboundinterface, the first message to the second node corresponding to theinbound interface.

In one embodiment, the transceiver unit is further configured to obtaina second forwarding label of a second packet, where the second packet isa discarded packet. The processing unit 12042 is further configured todetermine, based on the second forwarding label, that a protocol layerof the first node has an LSP corresponding to the second forwardinglabel. The processing unit 12042 is further configured to update aforwarding table at a forwarding layer of the first node based on theLSP corresponding to the second forwarding label.

In one embodiment, the processing unit 12042 is further configured todetermine that time for continuously discarding the packet including thefirst forwarding label is greater than or equal to preset duration, andthe first node obtains the first packet corresponding to the forwardinglabel.

In one embodiment, the first message is an RSVP message or an LDPmessage.

In one embodiment, the first message is an RSVP Hello message, the firstmessage carries object information, and the object information includesthe first forwarding label and an address of the first node; or thefirst message is an LDP notification message, the first message carriesa TLV, and the TLV includes the first forwarding label and the addressof the first node.

In one embodiment, the first forwarding table includes one or more of anext hop label forwarding entry NHLFE table and an incoming labelmapping ILM table.

In another possible embodiment, the transceiver unit is configured toreceive a first message from a first node, where the first messageincludes a first forwarding label and an address of the first node, andthe first message is used to indicate that the first node does not havean LSP corresponding to the first forwarding label. The processing unit12042 is configured to determine that the second node does not have anLSP corresponding to the first forwarding label of the first node. Theprocessing unit 12042 is further configured to delete a forwarding entrythat is in the second node and that is corresponding to the firstforwarding label of the first node.

In one embodiment, the processing unit 12042 is further configured to:determine that the second node does not have an LSP whose outgoing labelis corresponding to the first forwarding label and whose next-hopaddress is corresponding to an address of the first node; or determinethat a protocol layer of the second node has an LSP whose outgoing labelis corresponding to the first forwarding label and whose next-hopaddress is corresponding to an address of the first node, where the LSPis in a down state.

In one embodiment, the transceiver unit is further configured to receivea second message from the first node, where the second message includesa third forwarding label, and the second message is used to indicatethat the first node does not have an LSP corresponding to the thirdforwarding label. The processing unit 12042 is further configured todetermine an LSP that is in the second node and that is corresponding tothe third forwarding label of the first node. If the network device isan ingress node of the LSP, the processing unit 12042 is configured toreestablish the LSP, or if the network device is not an ingress node ofthe LSP, the transceiver unit sends a third message to the ingress nodeof the LSP, where the third message is used to indicate to reestablishthe LSP.

In one embodiment, the transceiver unit is further configured to receivea second message from the first node, where the second message includesa third forwarding label, and the second message is used to indicatethat the first node does not have an LSP corresponding to the thirdforwarding label. The processing unit 12042 is further configured todetermine an LSP that is in the second node and that is corresponding tothe third forwarding label of the first node. The transceiver unit isfurther configured to send a fourth message to the first node, where thefourth message is used to indicate the first node to re-advertise aforwarding label.

In one embodiment, the first message is an RSVP message or an LDPmessage.

In one embodiment, the first message is an RSVP Hello message, the firstmessage carries object information, and the object information includesthe first forwarding label and an address of the first node; or thefirst message is an LDP notification message, the first message carriesa TLV, and the TLV includes the first forwarding label and the addressof the first node.

In one embodiment, the second forwarding table includes one or more ofan NHLFE table, an ILM table, and an FEC table.

It may be understood that the foregoing function of the transceiver unitmay be implemented by the processor by invoking program code in thememory, and the processor may cooperate with the network interface 1202.Alternatively, a data receiving/sending operation may be completed bythe network interface 1202 on the network device 1200.

In various implementations, the network device 1200 is configured toperform the packet loss processing method provided in the embodiments ofthis application, for example, perform the packet loss processing methodcorresponding to the embodiment shown in FIG. 2, FIG. 3, FIG. 4, or FIG.11.

The foregoing describes the embodiments of this application in detail.Operations in the methods in the embodiments of this application may besequentially scheduled, combined, or deleted based on an actualrequirement. Modules in the apparatus in the embodiments of thisapplication may be divided, combined, or deleted based on an actualrequirement.

It should be understood that “one embodiment” or “an embodiment”mentioned in the entire specification does not mean that particularfeatures, structures, or characteristics related to the embodiment areincluded in at least one embodiment of this application. Therefore, “inone embodiment” or “in an embodiment” throughout the entirespecification does not necessarily refer to a same embodiment. Inaddition, these particular features, structures, or characteristics maybe combined in one or more embodiments in any appropriate manner. Itshould be understood that sequence numbers of the foregoing processes donot mean execution sequences in the embodiments of this application. Theexecution sequences of the processes should be determined based onfunctions and internal logic of the processes, and should not beconstrued as any limitation on the implementation processes of theembodiments of this application.

The term “and/or” in this specification describes only an associationrelationship for describing associated objects and represents that theremay be three relationships. For example, A and/or B may represent thefollowing three cases: Only A exists, both A and B exist, and only Bexists. In addition, the character “I” in this specification usuallyindicates an “or” relationship between the associated objects.

It should be understood that in the embodiments of this application, “Bcorresponding to A” indicates that B is associated with A, and B may bedetermined based on A. However, it should be further understood thatdetermining B based on A does not mean that B is determined based ononly A. B may alternatively be determined based on A and/or otherinformation.

A person of ordinary skill in the art may be aware that, the units andoperations in the examples described with reference to the embodimentsdisclosed herein may be implemented by electronic hardware, computersoftware, or a combination thereof. To clearly describeinterchangeability between the hardware and the software, the foregoinghas generally described compositions and operations of each examplebased on functions. Whether the functions are performed by hardware orsoftware depends on particular applications and design constraints ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of this application.

It may be clearly understood by a person skilled in the art that, forthe purpose of convenient and brief description, for a detailed workingprocess of the foregoing system, apparatus, and unit, refer to acorresponding process in the foregoing method embodiments. Details arenot described herein again.

In the several embodiments provided in this application, it should beunderstood that the disclosed system, apparatus, and method may beimplemented in other manners. For example, the described apparatusembodiment is merely an example. For example, division into the units ismerely logical function division and may be other division in an actualimplementation. For example, a plurality of units or components may becombined or integrated into another system, or some features may beignored or not performed. In addition, the displayed or discussed mutualcouplings or direct couplings or communication connections may beimplemented through some interfaces. The indirect couplings orcommunication connections between the apparatuses or units may beimplemented in electronic, mechanical, or another form.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may or may not be physical units,may be located in one position, or may be distributed on a plurality ofnetwork units. Some or all of the units may be selected based on anactual requirement to achieve the objectives of the solutions of theembodiments.

In addition, function units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software function unit.

When the integrated unit is implemented in the form of a softwarefunctional unit and sold or used as an independent product, theintegrated unit may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of thisapplication essentially, or the part contributing to the currenttechnology, or all or some of the technical solutions may be implementedin the form of a software product. The computer software product isstored in a storage medium and includes several instructions forinstructing a computer device (which may be a personal computer, aserver, or a network device) to perform all or some of the operations ofthe methods described in the embodiments of this application. Theforegoing storage medium includes any medium that can store programcode, for example a USB flash drive, a removable hard disk, a read-onlymemory, a random access memory, a magnetic disk, or an optical disc.

1. A packet loss processing method comprising: obtaining, by a firstnode, a first forwarding label of a first packet, wherein the firstpacket is a discarded packet; determining, by the first node based onthe first forwarding label, that the first node does not have a labelswitch path (LSP) corresponding to the first forwarding label; andsending, by the first node, a first message to a second node, whereinthe first message comprises the first forwarding label, and the firstmessage is used to indicate that the first node does not have the LSPcorresponding to the first forwarding label.
 2. The packet lossprocessing method according to claim 1, wherein the determining that thefirst node does not have a label switch path (LSP) corresponding to thefirst forwarding label comprises: determining that the first node doesnot have an LSP whose incoming label is the same as the first forwardinglabel.
 3. The packet loss processing method according to claim 1,wherein the sending, by the first node, a first message to a second nodecomprises: determining, by the first node, an inbound interfacecorresponding to the first packet; and sending, by the first node basedon the inbound interface, the first message to the second nodecorresponding to the inbound interface.
 4. The packet loss processingmethod according to claim 1, wherein the method further comprises:obtaining, by the first node, a second forwarding label of a secondpacket, wherein the second packet is a discarded packet; determining, bythe first node based on the second forwarding label, that a protocollayer of the first node has an LSP corresponding to the secondforwarding label; and updating, by the first node, a forwarding table ata forwarding layer of the first node based on the LSP corresponding tothe second forwarding label.
 5. The packet loss processing methodaccording to claim 1, wherein before the obtaining, by a first node, afirst forwarding label of a first packet, the method further comprises:determining, by the first node, that a time for continuously discardingthe packet comprising the first forwarding label is greater than orequal to a preset duration, and obtaining, by the first node, the firstpacket corresponding to the first forwarding label.
 6. The packet lossprocessing method according to claim 1, wherein the first message is aresource reservation protocol (RSVP) message or a label distributionprotocol (LDP) message.
 7. The packet loss processing method accordingto claim 6, wherein the first message is an RSVP Hello message, thefirst message carries object information, and the object informationcomprises the first forwarding label; or the first message is an LDPnotification message, the first message carries a type-length-value(TLV), and the TLV comprises the first forwarding label.
 8. The packetloss processing method according to claim 4, wherein the forwardingtable comprises one or more of a next hop label forwarding entry (NHLFE)table and an incoming label mapping (ILM) table.
 9. A network device,comprising: a non-transitory memory storing instructions; and aprocessor coupled to the non-transitory memory, wherein theinstructions, when executed by the processor, cause the first networkdevice to be configured to: receive a first message from a first node,wherein the first message comprises a first forwarding label, and thefirst message is used to indicate that the first node does not have alabel switch path (LSP) corresponding to the first forwarding label;determine, that the network device does not have an LSP corresponding tothe first forwarding label of the first node; and delete, a forwardingentry in the network device corresponding to the first forwarding labelof the first node.
 10. The network device according to claim 9, whereinthe instructions, when executed by the processor, further cause thenetwork device to be configured to: determine that the network devicedoes not have an LSP whose outgoing label is corresponding to the firstforwarding label and whose next-hop address is corresponding to anaddress of the first node; or determine that the network device has anLSP whose outgoing label is corresponding to the first forwarding labeland whose next-hop address is corresponding to an address of the firstnode, wherein the LSP is in a down state.
 11. The network deviceaccording to claim 9, wherein the instructions, when executed by theprocessor, further cause the network device to be configured to: receivea second message from the first node, wherein the second messagecomprises a third forwarding label, and the second message is used toindicate that the first node does not have an LSP corresponding to thethird forwarding label; determine an LSP that is in the network deviceand that is corresponding to the third forwarding label of the firstnode; and reestablish the LSP based on the network device is an ingressnode of the LSP, or send a third message to an ingress node of the LSPbased on the network device is not the ingress node of the LSP, whereinthe third message is used to indicate to reestablish the LSP.
 12. Thenetwork device according to claim 9, wherein the instructions, whenexecuted by the processor, further cause the network device to beconfigured to: receive a second message from the first node, wherein thesecond message comprises a third forwarding label, and the secondmessage is used to indicate that the first node does not have an LSPcorresponding to the third forwarding label; determine an LSP that is inthe network device and that is corresponding to the third forwardinglabel of the first node; and send a fourth message to the first node,wherein the fourth message is used to indicate the first node tore-advertise a forwarding label.
 13. The network device according toclaim 9, wherein the first message is an resource reservation protocol(RSVP) message or an label distribution protocol (LDP) message.
 14. Thenetwork device according to claim 9, wherein the first message is anRSVP Hello message, the first message carries object information, andthe object information comprises the first forwarding label; or thefirst message is an LDP notification message, the first message carriesa type-length-value (TLV), and the TLV comprises the first forwardinglabel.
 15. The network device according to claim 9, wherein theforwarding entry is located in one or more of an next hop labelforwarding entry (NHLFE) table, an incoming label mapping (ILM) table,and a forwarding equivalence class (FEC) table.
 16. A network device,comprising: a non-transitory memory storing instructions; and aprocessor coupled to the non-transitory memory, wherein theinstructions, when executed by the processor, cause the first networkdevice to be configured to: obtain a first forwarding label of a firstpacket, wherein the first packet is a discarded packet; determine basedon the first forwarding label, that the network device does not have alabel switch path (LSP) corresponding to the first forwarding label; andsend a first message to a second node, wherein the first messagecomprises the first forwarding label, and the first message is used toindicate that the network device does not have the LSP corresponding tothe first forwarding label.
 17. The network device according to claim16, wherein the instructions, when executed by the processor, furthercause the network device to be configured to: determine that the networkdevice does not have an LSP whose incoming label is the same as thefirst forwarding label.
 18. The network device according to claim 16,wherein the instructions, when executed by the processor, further causethe network device to be configured to: determine, an inbound interfacecorresponding to the first packet; and send based on the inboundinterface, the first message to the second node corresponding to theinbound interface.
 19. The network device according to claim 16, whereinthe instructions, when executed by the processor, further cause thenetwork device to be configured to: obtain a second forwarding label ofa second packet, wherein the second packet is a discarded packet;determine based on the second forwarding label, that a protocol layer ofthe network device has an LSP corresponding to the second forwardinglabel; and update a forwarding table at a forwarding layer of thenetwork device based on the LSP corresponding to the second forwardinglabel.
 20. The network device according to claim 16, wherein theinstructions, when executed by the processor, further cause the networkdevice to be configured to: determine, that a time for continuouslydiscarding the packet comprising the first forwarding label is greaterthan or equal to a preset duration, and obtain the first packetcorresponding to the first forwarding label.